package com.ikun.admin.modules.sys.controller;

import com.ikun.admin.modules.sys.iservice.ILogService;
import com.ikun.admin.modules.sys.vo.*;
import com.ikun.common.result.Result;
import com.ikun.common.search.PageData;
import com.ikun.common.search.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @ClassName LogController
 * @Description:
 * @CreateDate: 2024/6/1 0:39
 */
@Api("系统日志相关接口")
@RestController
@RequestMapping("/sys/log")
public class LogController {

    @Autowired
    private ILogService iLogService;


    @PostMapping("/logLogin/list/API_001")
    @ApiOperation("获取登录日志列表")
    public Result<PageResult<LogLoginListResultVo>> logLogin(@RequestBody PageData<BaseLogListParamVo> pageData) {
        return iLogService.logLogin(pageData);
    }
    @PostMapping("/logError/list/API_002")
    @ApiOperation("获取异常日志列表")
    public Result<PageResult<LogErrorListResultVo>> logError(@RequestBody PageData<LogErrorListParamVo> pageData) {
        return iLogService.logErro(pageData);
    }

    @PostMapping("/logEmail/list/API_003")
    @ApiOperation("获取邮件日志列表")
    public Result<PageResult<LogEmailListResultVo>> logEmail(@RequestBody PageData<LogEmailListParamVo> pageData){
        return iLogService.logEmail(pageData);
    }

    @PostMapping("/logOss/list/API_004")
    @ApiOperation("获取邮件日志列表")
    public Result<PageResult<LogOssListResultVo>> logOss(@RequestBody PageData<LogOssListParamVo> pageData){
        return iLogService.logOss(pageData);
    }

    @ApiOperation("操作日志")
    @PostMapping("/logOperation/list/API_005")
    public Result<PageResult<LogOperationListResultVo>> logOperation(@RequestBody PageData<LogOperationListParamVo> pageData){
        return iLogService.logOperation(pageData);
    }
}
